package com.qf.sy2103.fmmall.api.controller;


import com.qf.sy2103.common.vo.ResultVO;
import com.qf.sy2103.fmmall.beans.entity.Orders;
import com.qf.sy2103.fmmall.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @RequestMapping("/add")
    public ResultVO add(String cids,@RequestBody Orders order){

        return orderService.addOrder(cids,order);

    }

    @RequestMapping(value = "status/{orderId}",method = RequestMethod.GET)
    public ResultVO queryOrderStatus(@PathVariable("orderId") String orderId){
        return orderService.queryOrderStatus(orderId);
    }


}
